abstract class Shape {
    public abstract double calculateArea();
}
class Circle extends Shape {
    private double radius;

    public Circle(double radius) {
        this.radius = radius;
    }

    @Override
    public double calculateArea() {
        return Math.PI * radius * radius;
    }
}
class Rectangle extends Shape {
    private double length;
    private double width;

    public Rectangle(double length, double width) {
        this.length = length;
        this.width = width;
    }

    @Override
    public double calculateArea() {
        return length * width;
    }
}

public class Shapemain {
    public static void main(String[] args) {
        Shape[] shapes = new Shape[10];
        for (int i = 0; i < 10; i++) {
            int randomType = (int) (Math.random() * 2);
            if (randomType == 0) {
                double radius = Math.random() * 10 + 1;  // 随机生成半径范围在1 - 10之间
                shapes[i] = new Circle(radius);
            } else {
                double length = Math.random() * 10 + 1;  // 随机生成长度范围在1 - 10之间
                double width = Math.random() * 10 + 1;  // 随机生成宽度范围在1 - 10之间
                shapes[i] = new Rectangle(length, width);
            }
        }
        for (Shape shape : shapes) {
            System.out.println("该形状的面积是: " + shape.calculateArea());
        }
    }
}